package com.igd.business.dao;

import java.sql.SQLException;
import java.util.List;

import com.igd.exceptions.IgdException;
import com.igd.pojo.vo.PageList;
import com.igd.security.RoleResource;
import com.igd.security.Roles;

 /**
 * @version  1.0
 *
 * @author   QIAOYU
 *
 * @date     2013-7-11
 *
 * @description	 角色信息Dao接口
 */

public interface IRoleDao {
	
	/**
	 * 角色资源信息查询,带分页查询条件
	 * 
	 * @param pageList
	 * 
	 * @param roleResource
	 * 
	 * @return
	 * 
	 * @throws SQLException
	 * 
	 * @throws IgdException
	 */
	List<RoleResource> queryRoleResource(PageList pageList,RoleResource roleResource) throws SQLException, IgdException;
	
	/**
	 * 角色信息查询,带分页与查询条件
	 * 
	 * @param pageList
	 * 
	 * @param role
	 * 
	 * @return List<Roles>
	 * 
	 * @throws IgdException
	 *  
	 * @throws SQLException 
	 */
	List<Roles> queryAllRole(PageList pageList,Roles role) throws SQLException, IgdException;
	
	/**
	 * 角色信息查询,仅只能使用主键ID为条件
	 * 
	 * @param role
	 * 
	 * @return
	 * 
	 * @throws IgdException
	 *  
	 * @throws SQLException 
	 */
	Roles queryRoleInfo(Roles role) throws SQLException, IgdException;
	
	/**
	 * 角色信息删除
	 * 
	 * @param role
	 * 
	 * @throws IgdException 
	 * 
	 * @throws SQLException 
	 */
	void deleteRole(Roles role) throws SQLException, IgdException;
	
	/**
	 * 角色资源信息删除
	 * 
	 * @param roleRes
	 * 
	 * @throws SQLException
	 * 
	 * @throws IgdException
	 */
	void deleteRoleResource(RoleResource roleRes) throws SQLException, IgdException;
	
	/**
	 * 更新角色信息
	 * 
	 * @param role
	 * 
	 * @throws IgdException
	 *  
	 * @throws SQLException 
	 */
	void updRole(Roles role) throws SQLException, IgdException;
	
	/**
	 * 插入角色信息
	 * 
	 * @param role
	 * 
	 * @return
	 * 
	 * @throws IgdException
	 *  
	 * @throws SQLException 
	 */
	Roles insertRole(Roles role) throws SQLException, IgdException;
	
	/**
	 * 批量插入角色资源信息
	 * 
	 * @param List<RoleResource> roleRes
	 * 
	 * @return
	 * 
	 * @throws IgdException 
	 */
	boolean batchInsertRoleResource(final List<RoleResource> roleRes) throws IgdException;
}
